<?php
/*
Plugin Name: Slimbox WP Plugin
Plugin URI: http://code.google.com/p/slimbox-wp/
Original Script URI: http://www.digitalia.be/software/slimbox
Based on original WP plugin: http://www.4mj.it/slimbox-wordpress-plugin/
Description: This plugin is based on Slimbox 1.52 and 1.63 (developed by Christophe Beyls), a 4kb visual clone of the popular Lightbox JS v2.0 (developed by Lokesh Dhakar), written using the ultra compact mootools framework. It was designed to be small, efficient, more convenient and 100% compatible with the original Lightbox v2
Version: 1.0
Author: Jorge Serra
*/

// $mootools = "1.11";
$mootools = "1.2";

function slimbox() {
	global $mootools;
	$slimbox_path = get_option('siteurl')."/wp-content/plugins/slimbox/";
	$slimbox_script.= "<link rel=\"stylesheet\" href=\"".$slimbox_path."css/slimbox.css\" type=\"text/css\" media=\"screen\" />\n";
	if ($mootools == "1.11")
	{
		$slimbox_script.= "<script type=\"text/javascript\" src=\"".$slimbox_path."js/mootools_1.11.js\"></script>\n";
		$slimbox_script.= "<script type=\"text/javascript\" src=\"".$slimbox_path."js/slimbox_1.52.js\"></script>\n";
	}
	elseif ($mootools == "1.2")
	{
		$slimbox_script.= "<script type=\"text/javascript\" src=\"".$slimbox_path."js/mootools_1.2.js\"></script>\n";
		$slimbox_script.= "<script type=\"text/javascript\" src=\"".$slimbox_path."js/slimbox_1.63.js\"></script>\n";	
	}
	print($slimbox_script);
}

//	function slimbox_create($content){
//	return preg_replace('/<a(.*?)href=(.*?).(jpg|jpeg|png|gif|bmp|ico)"(.*?)>/i', '<a$1href=$2.$3" $4 rel="lightbox[roadtrip]">', $content);
//	}
//	add_filter('the_content', 'slimbox_create', 2);

add_action('wp_head', 'slimbox');

?>